#include<iostream>
using namespace std;

class DateAndYear{
private:
	int mouth;
	int year;
	friend bool equal(DateAndYear d1,DateAndYear d2);//友元函数
	void saywork(){
		cout<<"private saywork..."<<endl;
	}
public:
	DateAndYear(int m,int y){
		mouth=m;
		year=y;
	}

	int getMouth();
	int getYear();
};
int DateAndYear::getMouth(){
	return mouth;
}
int DateAndYear::getYear(){
	return year;
}

bool equal(DateAndYear d1,DateAndYear d2){
	d1.saywork();
	return (d1.mouth==d2.mouth)&&(d1.year==d2.year);
}


int main7(){
	DateAndYear d1(10,2018),d2(10,2018);
	cout<<equal(d1,d2)<<endl;
	return 0;
}
